﻿using ConsoleApp_core;
using System;
using System.Collections.Generic;
using System.Text;

namespace ConsoleApp
{
    public static class AppDBData
    {
        /// <summary>
        /// 模拟查询数据库的学生表
        /// </summary>
        /// <returns></returns>
        public static IEnumerable<Student> GetDBStudents()
        {
            for (int i = 1; i < 50; i++)
            {
                yield return new Student() { id = i, name = $"name_{i}" };
            }
        }

        /// <summary>
        /// 模拟查询数据库的学生表
        /// </summary>
        /// <returns></returns>
        public static IEnumerable<Student> GetDBMananyStudents()
        {
            for (int i = 1; i < 600; i++)
            {
                yield return new Student() { id = i, name = $"name_{i}" };
            }
        }


        //模拟查询数据库订单
        public static IEnumerable<Order> GetDBOrders()
        {
            for (int i = 1; i < 50; i++)
            {
                yield return new Order() { OrderID = $"{i}".PadLeft(5,'0'), CareteDate =DateTime.Now.AddHours(-1).AddMinutes(i) };
            }
        }
    }
}
